package paranoid;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class SurroundAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        Object[] objects = methodInvocation.getArguments();
        String username = (String) objects[0];

        System.out.println(username  + "登录验证");
        Object proceed = methodInvocation.proceed();

        System.out.println(username + "登录成功");

        return proceed;

    }
}
